Page({
  data: {
  curNav: 1,
  curIndex: 0,
  cateItems:[
    {
     "id":1,
     "name":"热门搜索",
     ishaveChild: true,
     children:[
      {
        child_id: 1,
        name: '情侣头像',
        image: "../../images/1.jpeg"
       },
       {
        child_id: 2,
        name: '聊天背景',
        image: "../../images/2.jpeg"
       },
       {
        child_id: 3,
        name: 'ins潮图',
        image: "../../images/3.jpeg"
       },
       {
        child_id: 4,
        name: '男头',
        image: "../../images/4.jpg"
       },
       {
        child_id: 5,
        name: '女头',
        image: "../../images/5.jpeg"
       },
       {
        child_id: 6,
        name: '沙雕头像',
        image: "../../images/6.jpeg"
       },
     ]
    },
    {
     "id": 2,
     "name": "动漫",
     ishaveChild: true,
     children:[
      {
        child_id: 1,
        name: '动漫头像',
        image: "../../images/7.jpg"
       },
       {
        child_id: 2,
        name: '动漫头像',
        image: "../../images/8.jpg"
       },
       {
        child_id: 3,
        name: '动漫头像',
        image: "../../images/9.jpeg"
       },
       {
        child_id: 4,
        name: '动漫头像',
        image: "../../images/10.jpg"
       },
      ]
    },
    {
     "id": 3,
     "name": "影视",
     ishaveChild: true,
     children:[
      {
        child_id: 1,
        name: '电影',
        image: "../../images/11.jpeg"
       },
       {
        child_id: 2,
        name: '电影',
        image: "../../images/12.jpeg"
       },
       {
        child_id: 3,
        name: '电影',
        image: "../../images/13.jpeg"
       },
       {
        child_id: 4,
        name: '电影',
        image: "../../images/14.jpeg"
       },
       {
        child_id: 5,
        name: '电影',
        image: "../../images/15.jpeg"
       },
       {
        child_id: 6,
        name: '影视',
        image: "../../images/16.jpeg"
       },
     ]
    },
    {
     "id": 4,
     "name": "壁纸"
    },
    {
     "id": 5,
     "name": "头像"
    },
  
    {
     "id": 6,
     "name": "表情"
    },
    {
     "id": 7,
     "name": "动图"
    },
    {
     "id": 8,
     "name": "文字"
    },
    {
     "id": 9,
     "name": "素材"
    },
    {
     "id": 10,
     "name": "萌宠"
    },
    {
     "id": 11,
     "name": "绘画"
    },
    {
     "id": 12,
     "name": "手作"
    },
    {
     "id": 13,
     "name": "时尚"
    }
   ],
  },
  switchRightTab: function (e) {
    let id = e.target.dataset.id,
    index = parseInt(e.target.dataset.index);
    this.setData({
      curNav: id,
      curIndex: index
    })
  },
  onLoad: function (options) {
    wx.setNavigationBarTitle({
      title: '发现',
    });
  }
 })